package cn.edu.zafu.bigdata.lekang;

public class Book {
    private String title;
    private String author;
    private double price;

    // 构造方法
    public Book(String title, String author, double price) {
        this.title = title;
        this.author = author;
        this.price = price;
    }

    // 重写toString()方法
    @Override
    public String toString() {
        return "Book[" +
                "title='" + title + '\'' +
                ", author='" + author + '\'' +
                ", price=" + price +
                ']';
    }
}

// 测试类
class BookTest {
    public static void main(String[] args) {
        // 创建Book对象
        Book book1 = new Book("高等数学", "张五", 29.99);
        Book book2 = new Book("线性代数", "李四", 19.99);

        // 打印Book对象的信息
        System.out.println(book1);
        System.out.println(book2);
    }
}